﻿// See https://aka.ms/new-console-template for more information
using PdfChartHelper.Models;
using PdfChartHelper.Writer;
using PdfSharpCore.Drawing;
using PdfSharpCore.Pdf;

#region 折起来

/*PdfDocument doc = PieWriter.DrawPieChartInModel(20, 30, 200, 
new List<PieModel>() {

    new PieModel(){ DESC = "Part1", Num = 200, },
    new PieModel(){ DESC = "Part2", Num = 200, },
    new PieModel(){ DESC = "Part3", Num = 300, },
    new PieModel(){ DESC = "Part4", Num = 30, },
    new PieModel(){ DESC = "Part5", Num = 450, },

});
*/
/*PdfDocument doc = HistogramWriter.RenderHistogram(20, 30, 200, 130, 
new List<Histogram>() {
    new Histogram() { desc = "part1",num = 199.2 },
    new Histogram() { desc = "part2",num = 67.1 },
    new Histogram() { desc = "part1",num = 129.2 },
    new Histogram() { desc = "part1",num = 166.2 },
    new Histogram() { desc = "part1",num = 30.2 },


});*/

/*PdfDocument doc = LineChartWriter.DrawLineChart(20, 30, 200, 130, new List<LineChart>() {


    new LineChart() { desc = "part1",num = 199.2 },
    new LineChart() { desc = "part2",num = 67.1 },
    new LineChart() { desc = "part1",num = 129.2 },
    new LineChart() { desc = "part1",num = 166.2 },
    new LineChart() { desc = "part1",num = 30.2 },

});



doc.Save("../../../Test.pdf");*/

#endregion


Dictionary<string, double> d1 = new Dictionary<string, double>(); d1.Add("power", 100); d1.Add("speed", 60); d1.Add("life", 45);
d1.Add("quality", 30); d1.Add("distance", 20);

Dictionary<string, double> d2 = new Dictionary<string, double>(); d2.Add("力量", 50); d2.Add("速度", 30); d2.Add("成长", 80);
d2.Add("quality", 99); d2.Add("distance", 60);

RadaModel[] models = new RadaModel[]
{
                new RadaModel("elem1")
                {
                    RadaValues = d1
                },
                new RadaModel("elem2")
                {
                    RadaValues = d2
                }
};

PdfDocument doc = new PdfDocument();
PdfPage page = new PdfPage(doc);
doc.AddPage(page);

RadarChartWriter.FiveChart(doc, new XPoint(100, 100), 70, models.ToList());

doc.Save("../../../Save.pdf");





